#pragma once

#include <string_view>

namespace Shaders
{
    std::string_view const EnergyParticleFS = R"(
#version 330 core
out vec4 FragColor;

in vec3 vColor;
uniform float zoom;
uniform bool onBackground;

void main()
{
    // Calculate distance from center of point
    vec2 coord = gl_PointCoord - vec2(0.5, 0.5);
    float dist = length(coord);
    
    // Discard pixels outside the circle
    if (dist > 0.5) {
        discard;
    }
    
    // Simple falloff for alpha based on distance from center
    float alpha;
    if (onBackground) {
        alpha = (1.0 - smoothstep(0.0, 0.5, dist)) * 0.05;
    } else {
        alpha = 1.0 - smoothstep(0.2, 0.5, dist);
    }
    
    FragColor = vec4(vColor * alpha, 1.0);
}
)";
}
